/**
 * 
 */
package jmine.tec.report.impl;

import java.io.Serializable;
import java.util.List;

import jmine.tec.report.ColumnFactory;
import jmine.tec.report.DataColumn;
import jmine.tec.report.ExecutableDataColumn;
import jmine.tec.report.ExecutableDataColumnContainer;
import jmine.tec.report.metadata.ColumnMetaData;

/**
 * Classe para adaptar uma {@link ColumnFactory} para um {@link DataColumn} usando um {@link ColumnMetaData}
 * 
 * @author takeshi
 */
public final class DataColumnFactoryAdaptor extends SimpleDataColumn implements ColumnFactory, DataColumn, Serializable {

    private static final long serialVersionUID = -46747015727976307L;

    private final ColumnFactory factory;

    /**
     * C'tor
     * 
     * @param factory the {@link ColumnFactory}
     * @param meta the {@link ColumnMetaData}
     */
    public DataColumnFactoryAdaptor(final ColumnFactory factory, final ColumnMetaData meta) {
        super(meta);
        this.factory = factory;
    }

    /**
     * @param container the {@link ExecutableDataColumnContainer}
     * @return {@link ExecutableDataColumn}
     */
    public List<ExecutableDataColumn> buildColumns(final ExecutableDataColumnContainer container) {
        return this.factory.buildColumns(container);
    }

}
